package com.bjpowernode.p2p.service.loan.impl;
import com.alibaba.dubbo.config.annotation.Service;
import com.bjpowernode.p2p.dao.BidInfoDao;
import com.bjpowernode.p2p.dao.LoanDao;
import com.bjpowernode.p2p.entity.BidInfo;
import com.bjpowernode.p2p.entity.LoanInfo;
import com.bjpowernode.p2p.service.loan.LoanInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
@Service(interfaceClass = LoanInfoService.class,version = "1.0",timeout = 15000)
public class LoanInfoServiceImpl implements LoanInfoService {

    @Autowired
    LoanDao loanDao;

    @Autowired
    BidInfoDao bidInfoDao;

    @Override
    public LoanInfo queryById(int id) {
        return loanDao.findById(id);
    }

    @Override
    public List<BidInfo> queryByUser(int loanId) {
        return bidInfoDao.findByloanId(loanId);
    }
}
